# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Domains.V1.Model.HealthCheckTargets do
  @moduledoc """
  HealthCheckTargets describes endpoints to health-check when responding to Routing Policy queries. Only the healthy endpoints will be included in the response. Set either `internal_load_balancer` or `external_endpoints`. Do not set both.

  ## Attributes

  *   `externalEndpoints` (*type:* `list(String.t)`, *default:* `nil`) - The Internet IP addresses to be health checked. The format matches the format of ResourceRecordSet.rrdata as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1)
  *   `internalLoadBalancer` (*type:* `list(GoogleApi.Domains.V1.Model.LoadBalancerTarget.t)`, *default:* `nil`) - Configuration for internal load balancers to be health checked.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :externalEndpoints => list(String.t()) | nil,
          :internalLoadBalancer => list(GoogleApi.Domains.V1.Model.LoadBalancerTarget.t()) | nil
        }

  field(:externalEndpoints, type: :list)
  field(:internalLoadBalancer, as: GoogleApi.Domains.V1.Model.LoadBalancerTarget, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Domains.V1.Model.HealthCheckTargets do
  def decode(value, options) do
    GoogleApi.Domains.V1.Model.HealthCheckTargets.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Domains.V1.Model.HealthCheckTargets do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
